package api03a;

import jdk.jshell.EvalException;

import java.util.HashMap;
import java.util.Map;

public class MapDemo2 {
    public static void main(String[] args) {
        Map<String,Integer> map = new HashMap<>();  //无序
        map.put("语文",99);
        map.put("数学",100);
        map.put("英语",88);
        map.put("物理",96);
        map.put("化学",99);
        System.out.println(map);

        System.out.println(map.size());
        System.out.println(map.isEmpty());
        System.out.println("map是否包含数学这个键:"+map.containsKey("数学"));
        System.out.println("是否包含95这个值:"+map.containsValue(99));

        map.remove("数学");
        System.out.println(map);

        Integer value = map.remove("物理");
        System.out.println(value);
        System.out.println(map);

        map.clear();
        System.out.println(map);








    }
}
